<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="com.cap.bts.framework.usermgnt.constant.EmployeeStatus"%>    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>经销商维护</title>
<%@include file="../include/include.jsp"%>
<link rel="stylesheet" type="text/css" href="${csspath }/public.css"/>
<link rel="stylesheet" type="text/css" href="${csspath }/datepicker.css"/>
<link rel="stylesheet" type="text/css" href="${csspath }/style_l.css"/>
<script type="text/javascript" src="${jspath }/jquery-1.4.4.js"></script>
<script type="text/javascript" src="${jspath }/jquery.ui.min.js"></script>
<script type="text/javascript" src="${jspath }/ui.datepicker_zh-CN.js"></script>
<script type="text/javascript" src="${jspath }/jquery.blockUI.js"></script>
<script type="text/javascript" src="${jspath }/public.js"></script>
<script type="text/javascript" src="${jspath }/jquery.selectAll.js"></script>
<script type="text/javascript" src="${jspath}/jquery/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="${jspath}/jquery/jquery.alerts.js"></script>
<link rel="stylesheet" type="text/css" href="${csspath}/jquery.alerts.css" />

<link rel="stylesheet" type="text/css"
	href="${webcontext}/css/validationEngine.jquery.css" />
<script src="${jspath}/jquery/validate/jquery.validationEngine.js"
	type="text/javascript"></script>
<script src="${jspath}/jquery/validate/jquery.validationEngine-zh.js"
	type="text/javascript"></script>
	<script type="text/javascript"
	src="${webcontext}/javascript/jquery/jquery.ui.draggable.js"></script>
<style type="text/css">
.formError .formErrorContent {
    -moz-border-radius: 6px 6px 6px 6px;
    -moz-box-shadow: 0 0 6px #000000;
    background: none repeat scroll 0 0 #EE0101;
    border: 2px solid #DDDDDD;
    color: #FFFFFF;
    font-family: tahoma;
    font-size: 11px;
    padding: 4px 10px;
    width: 100px;
}
</style>

<script type="text/javascript">
var myHeight = 0;
$(function(){
	
	$("#search_form").validationEngine(
			{
             promptPosition:"topLeft",
             success:false,
             validationEventTriggers:"blur",
             scroll : false,
			 failure:function(){} 
	});
	
	
	$("#add").click(function(){
		$(this).attr("href", "${webcontext}/crmdp/dealer/masterdata/toCreateDealerPage");
		
	});

	$("#edit").click(function(){
		
		if ($(":radio:checked").length > 0)
		{  

			jConfirm("确认修改此经销商？","确认提示",function(result){
	    		if(result == true)
	    		{
	    			location.href="${webcontext}/crmdp/dealer/masterdata/toEditDealerPage?id="+$(":radio:checked").val();
	    		}
	    	});
			
		}else {
			
		    jAlert("请选择经销商！","提示信息");
		} 
	});
	
});

function search(){
	document.getElementById("search_form").submit();
}

</script> 
</head>
<body>

	<!-- content -->
	<div id="content">
		<!-- wrap -->
		<div id="wrap">

			<!-- breadcrumb -->
			<div id="breadcrumb">
				<span>经销商维护</span>
			</div>

			<!-- /breadcrumb -->
			<!-- search_div -->
			<form:form id="search_form" action="${webcontext}/crmdp/dealer/masterdata/getMaintainDealerPage" method="post" modelAttribute="dto">
			<div class="search_div">
				<div class="spliter h_10"></div>
				<table class="search_tab">
					<tr>
					  <td class="label">经销商编号：</td>
					  <td><form:input path="dealerNum" cssClass="validate[length[0,6]] text string"/></td>
					  <td class="label">经销商名称：</td>
					  <td><form:input path="dealerName" cssClass="validate[length[0,240]] text string"/></td>
					  <td class="label">经销商手机：</td>
					  <td><form:input path="contactPhone" cssClass="validate[custom[NullOrMobile]]  text string"/></td>
					  <td class="label">经销商状态：</td>
					  <td>
					    <form:select path="dealerStatus" class="sel">  
					  	 <form:option value="">请选择</form:option>
				        <%= CodeTextUtils.getOptions("MasterDataDealerInfo.DealerStatus","" ) %>
						</form:select>
						<!--<script type="text/javascript">
						$("#dealerStatus").val("${dto.dealerStatus}");
						</script>
					  </td>
				    </tr>
					<tr>
					 <!-- <td class="label">经销商区域：</td>
					  <td><form:input path="region" cssClass="validate[length[0,50]] text string"/>
					  <td class="label">经销商所在省：</td>
					  <td>
					    <form:select path="province" class="sel">  
					  	 <form:option value="0">请选择</form:option>
				        <!-- %= CodeTextUtils.getOptions("Employee.WorkStatus","" ) %>
						</form:select>
						<script type="text/javascript">
						$("#province").val("${dto.province}");
						</script>
					  </td>
					  <td class="label">经销商所在市：</td>
					  <td>
					    <form:select path="city" class="sel">  
					  	 <form:option value="0">请选择</form:option>
				        <!-- %= CodeTextUtils.getOptions("Employee.WorkStatus","" ) %>
						</form:select>
						<script type="text/javascript">
						$("#city").val("${dto.city}");
						</script>
					  </td>
					  <td class="label">经销商地址：</td>
					  <td><form:input path="address" cssClass="validate[length[0,240]] text string"/>-->
				  </tr>
					<tr>
						<td colspan="8" class="center2">
							<input type="submit" class="btn" value="查询"/>&nbsp;&nbsp;<input type="reset" class="btn" value="重置"/>
						</td>
					</tr>
				</table>
				<div class="spliter h_10"></div>
			</div>
			<!-- /search_div -->
		
			<div class="spliter h_10"></div>
			<!-- page_div -->

			<div class="page_div">
				<div class="page_info">
                    <a class="add" id="add">新增</a>
                    <a class="edit" id="edit">编辑</a>
                    <!-- <a  id="detail" class="search">详情</a>
			  		<a  id="delete" class="delete">删除</a> -->
                </div> 
				<div class="page_opts">
                   <%@include file="../common/headerpage.jsp"%>		
				</div>
			</div>
			<!-- /page_div -->
			<!-- data_div -->
			<div class="data_div">
				<table class="data_tab">

					<tr>
						<th width="6%" align="left">选择</th>
                        <th width="10%" align="left">编号</th>
						<th width="30%" align="left">名称</th>
						<th width="20%" align="left">类型</th>
						<th width="20%" align="left">区域</th>
                        <th width="10%" align="left">省</th>
                        <th width="10%" align="left">市</th>
                        <th width="40%" align="left">地址</th>
                        <th width="15%" align="left">联系人</th>
                        <th width="18%" align="left">手机</th>
                        <th width="22%" align="left">状态</th>
                    </tr>
                  <core:forEach items="${dealerResultsDtoList}" var="dealerResultsDto">
					<tr>
						<td class="align_m"><input type="radio" name="id" class="select_one" value="${dealerResultsDto.id}" /></td>
                        <td>${dealerResultsDto.dealerNum}</td>
                        <td>${dealerResultsDto.dealerName}</td>
                        <td>${dealerResultsDto.dealerProgram}</td>
                        <td>${dealerResultsDto.region}</td>
                        <td>${dealerResultsDto.province}</td>
                        <td>${dealerResultsDto.city}</td>
                        <td>${dealerResultsDto.address}</td>
                        <td>${dealerResultsDto.contactName}</td>
                        <td>${dealerResultsDto.contactPhone}</td>
                        <td>${dealerResultsDto.dealerStatus}</td>
                    </tr>
                 </core:forEach>                    
                    
				</table>
</div>
			<!-- /data_div -->
            
            <!-- page_div -->
			<div class="page_div">
			    <%@include file="../common/page.jsp"%>
			</div>
			<!-- /page_div -->
           </form:form>
		</div>
		<!-- /wrap -->
	</div>
	<!-- /content -->

  </body>

</html>